{include file="common/header"}
<div class="content-wrapper">
    {include file="member/nav"/}
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    {include file="member/tabs"/}
                    <div class="tab-content">
                        <form method="post" class="form-horizontal form" id="post_form">
                            <div class="panel panel-info">
                                <div class="panel-heading">
                                    编辑会员
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">手机号</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" name='username' value="{$item['username']?$item['username']:''}" placeholder="">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">昵称</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" readonly="readonly" value="{$item['nickname']?$item['nickname']:''}" placeholder="">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">新密码</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" name="password" value="" placeholder="需要修改密码时请输入，否则请留空">
                                        </div>
                                    </div>
                                    {:tpl_upload_image(['name'=>'avatar','title' => '头像','value'=>!empty($item['avatar'])?$item['avatar']:'','placeholder'=>'请上传用户头像','help'=>'建议宽高：200*200'])}
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">积分</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" readonly="readonly" value="{$item['credit1']?$item['credit1']:'0'}" placeholder="">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">余额</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" readonly="readonly" value="{$item['credit2']?$item['credit2']:'0'}" placeholder="">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付宝账号</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" readonly="readonly" value="{$item['alipay_account']?$item['alipay_account']:''}" placeholder="">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付宝姓名</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" readonly="readonly" value="{$item['alipay_realname']?$item['alipay_realname']:''}" placeholder="">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">手机</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control" readonly="readonly" placeholder="" value="{$item['mobile']?$item['mobile']:''}">
                                        </div>
                                    </div>
                                     <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">级别</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <label class="radio-inline">
                                                <input type="radio" name="level" {$item['level']==1?'checked':''} value="1">
                                                普通会员
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="level" {$item['level']==2?'checked':''} value="2">
                                               年卡 VIP会员
                                            </label>
                                             <label class="radio-inline">
                                                <input type="radio" name="level" {$item['level']==3?'checked':''} value="3">
                                                月卡VIP会员
                                            </label>
                                             <label class="radio-inline">
                                                <input type="radio" name="level" {$item['level']==4?'checked':''} value="4">
                                                周卡VIP会员
                                            </label>
                                        </div>
                                    </div>
                                  
                                  <div class="form-group vipornot" style="display:none">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员截至日期</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control"  readonly="readonly"  placeholder="" value="{:date('Y-m-d H:i:s',$item['level_time'])}">
                                        </div>
                                    </div>
                                  
                                  <div class="form-group vipaddtianshu" style="display:none">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">增加天数</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control"  name="vipaddtianshu" />
                                        </div>
                                    </div>
                                  
                                  <script>
									$(function(){
                                    var level = $("input[name=level]:checked").val();
                                      if(level != 1){
                                       $(".vipornot").css("display","block"); 
                                      }
                                      
                                      $("input[name=level]").click(function(){
                                      	var xiugailevel = $(this).val();
                                        if(xiugailevel == 1){
                                          $(".vipornot").css("display","none"); 
                                        }else{
                                          $(".vipornot").css("display","block"); 
                                          $(".vipaddtianshu").css("display","block"); 
                                        }
                                      	
                                      })
                                      
                                      
                                    })
                                  
                                  
                                  </script>
                                  
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">状态</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <label class="radio-inline">
                                                <input type="radio" name="is_check" value="1" {$item['is_check']?'checked':''}>
                                                正常
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="is_check" value="0" {$item['is_check']?'':'checked'}>
                                                已禁用 
                                            </label>
                                        </div>
                                    </div>
                                    
                                     <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">禁用原因</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="text" class="form-control"  name="frozen_reason" placeholder="" value="{$item['frozen_reason']?$item['frozen_reason']:''}">
                                        </div>
                                    </div>  
                                    
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">解封时间</label>
                                        <div class="col-sm-6 col-xs-12">
                                            <input type="date" class="form-control"  name="frozen_time" placeholder="" value="{$item['frozen_time']?$item['frozen_time']:''}">
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="form-group">
                                        <div class="col-sm-6 col-xs-12 col-sm-offset-2">
                                            <input type="hidden" name="uid" value="{$item['uid']?$item['uid']:0}">
                                            <button type="button" name="submit" class="btn btn-primary">提交</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <script type="text/javascript">
                            $(function () {
                                //提交分类信息
                                $("button[name='submit']").click(function () {
                                    $.post(
                                        window.location.href,
                                        $('#post_form').serialize(),
                                        function (res) {
                                            message(res.message,res.redirect,res.type)
                                        },'json'
                                    );
                                });
                            });
                        </script>
                    </div>
                    <!-- /.tab-content -->
                </div>
                <!-- /.nav-tabs-custom -->
            </div>
            <!-- /.col -->
        </div>
    </section>
</div>
{include file='common/ufooter'}
